<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>

<s:layout-render name="/newjsp.jsp">
    <s:layout-component name="hlavicka">
        <h4><f:message key="nadpis.services"/></h4>
    </s:layout-component>
    <s:layout-component name="telo">
        <s:useActionBean beanclass="pneuservis.frontend.web.ServicesActionBean" var="actionBean"/>
        <f:message key="key.allServices" />
        <table class="zakladni">
            <tr>
                <th><f:message key="key.ID" /></th>
                <th><f:message key="key.name" /></th>
                <th><f:message key="key.price" /></th>
            </tr>
            <c:forEach items="${actionBean.services}" var="service">
                <tr>
                    <td>${service.id}</td>
                    <td><c:out value="${service.name}"/></td>
                    <td><c:out value="${service.price}"/></td>
                    <td><s:link beanclass="pneuservis.frontend.web.ServicesActionBean" event="delete" onclick="return confirm('Delete ${service}?');"><s:param name="service.id" value="${service.id}"/><f:message key="key.delete" /></s:link> </td>
                    <td><s:link beanclass="pneuservis.frontend.web.ServicesActionBean" event="edit"><s:param name="service.id" value="${service.id}"/><f:message key="key.edit" /></s:link> </td>
                </tr>
            </c:forEach>
        </table>
            <br/><br/>
        <s:form beanclass="pneuservis.frontend.web.ServicesActionBean">
            <fieldset><legend><f:message key="key.newService" /></legend>
                <%@include file="/forms/formService.jsp"%>
                <s:submit name="add"><f:message key="key.newService1" /></s:submit>
            </fieldset>
        </s:form>
    </s:layout-component>
</s:layout-render>